package cn.wolfcode.trip.api.controller;

import cn.wolfcode.trip.core.domain.StrategyDetail;
import cn.wolfcode.trip.core.service.IStrategyDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 大攻略文章资源控制器
 */
@RestController
@RequestMapping("strategyDetails")
public class StrategyDetailController {

    @Autowired
    private IStrategyDetailService detailService;

    /**
     *  根据攻略文章id查询文章内容
     * 1.资源路径 /strategyDetails/{id}
     * 2.请求动作 get
     * 3.请求参数 无
     * 4.返回结果 攻略文章对象
     */
    @GetMapping("{id}")
    public StrategyDetail getById(@PathVariable Long id){

        return detailService.getById(id);
    }

}
